package com.letoy.study.service.Impl;

import com.letoy.study.dao.ApiMapper;
import com.letoy.study.entity.MyApi;
import com.letoy.study.service.ApiService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ApiServiceImpl implements ApiService {

    @Resource
    ApiMapper apiMapper;

    @Override
    public List<MyApi> getMyApiListByUserId(String userId) {
        return apiMapper.getApiListByUserId(userId);
    }

    @Override
    public int insertApi(MyApi myApi) {
        if (apiMapper.insertApi(myApi) >= 1) {
            return 0;
        } else {
            return 10;
        }
    }
}
